//注意取模仅用于整数
#include <stdio.h>

int main(void)
{
    int dividend, divisor;

    puts("This program computes moduli.");
    printf("Enter an integer to serve as the second operand: ");
    scanf("%d", &divisor);
    printf("Now enter the first operand: ");
    while (scanf("%d", &dividend) == 1 && dividend > 0)
    {
        printf("%d %% %d is %d\n", dividend, divisor, dividend % divisor);

        printf("Enter next number for first operand (0 <= to quit): ");
    }
    puts("Done");

    return 0;
}